package winOrDie.Net.Client;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import winOrDie.Net.Server.WoD_Server_Client;

/**
 * This public class provides the basic WoD_Peer structure
 *
 */
public class WoD_Peer 
{
	/**
	 ***************************************************************************************************************
	 * Peer identification
	 ***************************************************************************************************************
	 */
	private String userName = null;	
	private int cliend_Id = -1;
	
	/**
	 ***************************************************************************************************************
	 * Peer communication parameters
	 ***************************************************************************************************************
	 */
	private String scribeNode_ID = null;
	private String hostDirection = null;
	private int voice_UDP_Port = -1;
	
	/**
	 ***************************************************************************************************************
	 * Backup port for TCP option
	 ***************************************************************************************************************
	 */
	private int tcp_backup = -1;

	/**
	 ***************************************************************************************************************
	 * Game Settings
	 ***************************************************************************************************************
	 */
	private int team = -1;
	private int ROL = -1;
	private boolean readyToGo = false;

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public int getCliend_Id() {
		return cliend_Id;
	}

	public void setCliend_Id(int cliendId) {
		cliend_Id = cliendId;
	}

	public String getScribeNode_ID() {
		return scribeNode_ID;
	}

	public void setScribeNode_ID(String scribeNodeID) {
		scribeNode_ID = scribeNodeID;
	}

	public String getHostDirection() {
		return hostDirection;
	}

	public void setHostDirection(String hostDirection) {
		this.hostDirection = hostDirection;
	}

	public int getVoice_UDP_Port() {
		return voice_UDP_Port;
	}

	public void setVoice_UDP_Port(int voiceUDPPort) {
		voice_UDP_Port = voiceUDPPort;
	}

	public int getTcp_backup() {
		return tcp_backup;
	}

	public void setTcp_backup(int tcpBackup) {
		tcp_backup = tcpBackup;
	}
	
	public int getTeam() {
		return team;
	}

	public void setTeam(int team) {
		this.team = team;
	}

	public int getROL() {
		return ROL;
	}

	public void setROL(int rOL) {
		ROL = rOL;
	}

	public boolean isReadyToGo() {
		return readyToGo;
	}

	public void setReadyToGo(boolean readyToGo) {
		this.readyToGo = readyToGo;
	}

	public WoD_Peer() {
	
	}
	
	/**
	 * WoD_Peer contructor from {@link WoD_Server_Client} object passed as parameter
	 * @param woDServerClient
	 */
	public WoD_Peer(WoD_Server_Client woDServerClient) {
		setUserName(woDServerClient.getUserName());
		setCliend_Id(woDServerClient.getCliend_Id());
		setScribeNode_ID(woDServerClient.getScribeNode_ID());
		setHostDirection(woDServerClient.getHostDirection());
		setVoice_UDP_Port(woDServerClient.getVoice_UDP_Port());
		setTcp_backup(woDServerClient.getTcp_backup());
		setTeam(woDServerClient.getTeam());
		setROL(woDServerClient.getROL());
		setReadyToGo(woDServerClient.isReadyToGo());
	}
	
	
	/**
	 * This public method returns {@link Element} data from this {@link WoD_Peer}
	 * @param document
	 * @return {@link Element}
	 */
	public Element get_XML_Element(Document document)
	{
		return WoD_Peer_Editor.get_Element_From_WoD_Peer(this, document);
	}
	
}
